There have been disclosed position detection systems, in which a light source of an infrared light is used as a marker whose image is taken by an image pickup device, and the taken image is analyzed to obtain a position and direction of the image pickup device. One of such systems is disclosed in, e.g., Japanese Laid-Open Patent Publication No. 11-305935 (hereinafter, referred to as a patent document 1).
The patent document 1 discloses a game as an embodiment of a position detection system in which a player uses, as a game controller, a gun having an image pickup device mounted thereon, and performs shooting. In the system, four light sources each emitting an infrared light, which are respectively fixed on four corners of a display screen, are used as markers, and a position on the display screen pointed by the gun is detected based on positions of the markers in an image taken by the image pickup device. Then, a virtual shooting game is executed by using the position pointed by the gun as a position aimed at by the player. As disclosed in the 15th paragraph of the patent document 1, in the case where two markers are used, a distance between the position aimed at by the player and each marker can be obtained if an axis of the image pickup device and an axis of said each marker are in parallel.
However, in the case where the two markers are used in the position detection system disclosed in the above patent document 1, the distance between the position aimed at by the player and each marker cannot be obtained if the axis of the image pickup device and the axis of said each marker are not in parallel.
Therefore, a feature of certain exemplary embodiments is to provide a position calculation apparatus, a storage medium storing a position calculation program, a game apparatus, and a storage medium storing a game program which are, when calculating a distance between an input device having an image pickup device and two imaging targets, capable of calculating a positional relationship between the input device and the two imaging targets even if the image pickup device is diagonally positioned with respect to the imaging targets.
Certain exemplary embodiments have the following aspects to attain the feature mentioned above. Note that reference numerals, step numbers (here, “step” is abbreviated as “S”) and the like indicated between parentheses are merely provided to facilitate the understanding of certain exemplary embodiments in relation to the drawings and are not intended to be limiting in any way.
A first aspect relates to a position calculation apparatus (3) for calculating a positional relationship (realD, δ1, δ2) between an image pickup device (74), which is for taking an image of first and second imaging targets (8L, 8R), and at least one of the imaging targets. The position calculation apparatus comprises target image size obtaining means (S101) and positional relationship calculation means (S107). The target image size obtaining means is means for obtaining a first size (Da1), which indicates a size (diamL) of a target image of the first imaging target in the image taken by the image pickup device, and a second size (Da2), which indicates a size (diamR) of a target image of the second imaging target in the image taken by the image pickup device. The positional relationship calculation means is means for, based on the first and second sizes, calculating the positional relationship between the image pickup device and the at least one of the imaging targets. Note that, the target image size obtaining means may obtain the first and second sizes calculated by the image pickup device. Alternatively, the target image size obtaining means may calculate and obtain the first and second sizes from the taken image.
In a second aspect based on the first aspect, the positional relationship calculation means includes imaging target distance calculation means (S103, S105) for, based on the first size and an actual size (diamM) of the first imaging target which corresponds to the first size, calculating a first distance (realDL) between the image pickup device and the first imaging target, and for, based on the second size and an actual size (diamM) of the second imaging target which corresponds to the second size, calculating a second distance (realDR) between the image pickup device and the second imaging target. Based on the first and second distances and an actual setting distance (m) between the first and second imaging targets, the positional relationship calculation means calculates, as the positional relationship between the image pickup device and the at least one of the imaging targets, a positional relationship between the image pickup device and a predetermined point between the first and second imaging targets.
In a third aspect based on the second aspect, the positional relationship calculation means calculates, as the positional relationship, a distance (realD) between the image pickup device and a middle point between the first and second imaging targets.
In a fourth aspect based on the second aspect, the positional relationship calculation means calculates, as the positional relationship, a placement direction (δ2) which is a direction from the image pickup device to a middle point between the first and second imaging targets.
In a fifth aspect based on the second aspect, the positional relationship calculation means calculates, as the positional relationship, a placement direction (δ1) which is a direction from the image pickup device to one of the first and second imaging targets.
In a sixth aspect based on the third aspect, the positional relationship calculation means includes angle calculation means (S106) for, based on the first and second distances and the actual setting distance, calculating an angle (δ1) between a line connecting the first and second imaging targets and a line connecting the first imaging target and the image pickup device. Based on the angle, the first distance and a half length of the actual setting distance, the positional relationship calculation means calculates a distance between the middle point and the image pickup device.
In a seventh aspect based on the sixth aspect, by using the first distance, the half length of the actual setting distance, and the distance between the middle point and the image pickup device, the positional relationship calculation means further calculates, as the positional relationship, a placement angle (δ2) which is an angle between the line connecting the first and second imaging targets and a line connecting the middle point and the image pickup device.
An eighth aspect relates to a game apparatus (3) comprising the position calculation apparatus of the first aspect, game processing means (30) and display control means (32). The game processing means is means for, based on the positional relationship calculated by the positional relationship calculation means, performing a predetermined game process (FIGS. 17 to 19) for a virtual game world. The display control means is means for sequentially causing a display device (2) to display at least a portion of the virtual game world.
In a ninth aspect based on the eighth aspect, the game processing means determines, based on the positional relationship, a position of a virtual camera (C) placed in the virtual game world. The display control means sequentially causes the display device to display at least the portion of the virtual game world whose image is taken by the virtual camera (FIG. 18).
In a tenth aspect based on the eighth aspect, the game processing means determines, based on the positional relationship, a position of a predetermined object (PC) appearing in the virtual game world (FIG. 19).
In an eleventh aspect based on the eighth aspect, the image pickup device is provided in a single case (7, 71) together with a vibration generator (7θ4) for, when actuated, generating predetermined vibration. The game processing means controls, based on the positional relationship, the vibration generated by the vibration generator.
Twelfth, thirteenth and fourteenth aspects relate to game apparatuses respectively comprising position calculation apparatuses of the fourth, fifth and seventh aspects, and each of the game apparatuses further comprises game processing means and display control means. In each of the twelfth, thirteenth and fourteenth aspects: the game processing means is means for performing a predetermined game process for a virtual game world; the display control means is means for sequentially causing a display device to display at least a portion of the virtual game world; the positional relationship calculation means calculates placement directions or placement angles for a plurality of image pickup devices, respectively; and the display control means divides a display area of the display device into a plurality of display areas, and based on the placement directions or placement angles, allocates the plurality of display areas to the plurality of image pickup devices, respectively (FIG. 17).
A fifteenth aspect relates to a game apparatus comprising the position calculation apparatus of the first aspect, game processing means, display control means and sound control means (34). The game processing means is means for performing a predetermined game process for a virtual game world. The display control means is means for sequentially causing a display device to display at least a portion of a virtual game world. The sound control means is means for causing a plurality of speakers (2a) to output sound in accordance with the predetermined game process performed by the game processing means. The sound control means controls, based on the positional relationship, volume of the sound outputted from the speakers.
A sixteenth aspect relates to a storage medium storing a position calculation program to be executed by a computer (30) which calculates a positional relationship between an image pickup device, which is for taking an image of first and second imaging targets, and at least one of the first and second imaging targets. The position calculation program causes the computer to perform a target image size obtaining step and a positional relationship calculation step. The target image size obtaining step is a step of obtaining a first size, which indicates a size of a target image of the first imaging target in the image taken by the image pickup device, and a second size, which indicates a size of a target image of the second imaging target in the image taken by the image pickup device. The positional relationship calculation step is a step of, based on the first and second sizes, calculating the positional relationship between the image pickup device and the at least one of the imaging targets.
In a seventeenth aspect based on the sixteenth aspect, the positional relationship calculation step includes an imaging target distance calculation step of, based on the first size and an actual size of the first imaging target which corresponds to the first size, calculating a first distance between the image pickup device and the first imaging target, and, based on the second size and an actual size of the second imaging target which corresponds to the second size, calculating a second distance between the image pickup device and the second imaging target. Based on the first and second distances and an actual setting distance between the first and second imaging targets, the positional relationship calculation step calculates, as the positional relationship between the image pickup device and the at least one of the imaging targets, a positional relationship between the image pickup device and a predetermined point between the first and second imaging targets.
In an eighteenth aspect based on the seventeenth aspect, at the positional relationship calculation step, a distance between the image pickup device and a middle point between the first and second imaging targets is calculated as the positional relationship.
In a nineteenth aspect based on the seventeenth aspect, at the positional relationship calculation step, a placement direction which is a direction from the image pickup device to a middle point between the first and second imaging targets is calculated as the positional relationship.
In a twentieth aspect based on the seventeenth aspect, at the positional relationship calculation step, a placement direction which is a direction from the image pickup device to one of the first and second imaging targets is calculated as the positional relationship.
In a twenty-first aspect based on the eighteenth aspect, the positional relationship calculation step includes an angle calculation step of, based on the first and second distances and the actual setting distance, calculating an angle between a line connecting the first and second imaging targets and a line connecting the first imaging target and the image pickup device. At the positional relationship calculation step, a distance between the middle point and the image pickup device is calculated based on the angle, the first distance, and a half length of the actual setting distance.
A twenty-second aspect based on the twenty-first aspect, at the positional relationship calculation step, a placement angle, which is an angle between the line connecting the first and second imaging targets and a line connecting the middle point and the image pickup device, is further calculated, as the positional relationship, based on the first distance, the half length of the actual setting distance, and the distance between the middle point and the image pickup device.
A twenty-third aspect based on the sixteenth aspect is a game program for causing the computer of the sixteenth aspect to perform: the steps which the position calculation program of the sixteenth aspect causes the computer to perform; a game processing step; and a display control step. The game processing step is a step of, based on the positional relationship calculated at the positional relationship calculation step, performing a predetermined game process for a virtual game world. The display control step is a step of sequentially causing a display device to display at least a portion of the virtual game world.
In a twenty-fourth aspect based on the twenty-third aspect, at the game processing step, a position of a virtual camera placed in the virtual game world is determined based on the positional relationship, and at the display control step, the display device is sequentially caused to display at least the portion of the virtual game world whose image is taken by the virtual camera.
In a twenty-fifth aspect based on the twenty-third aspect, at the game processing step, a position of a predetermined object appearing in the virtual game world is determined based on the positional relationship.
In a twenty-sixth aspect based on the twenty-third aspect, the image pickup device is provided in a single case together with a vibration generator for, when actuated, generating predetermined vibration, and at the game processing step, the vibration generated by the vibration generator is controlled based on the positional relationship.
A twenty-seventh aspect relates to a game program for causing the computer of the nineteenth aspect to perform the steps which the position calculation program of the nineteenth aspect causes the computer to perform; a twenty-eighth aspect relates to a game program for causing the computer of the twentieth aspect to perform the steps which the position calculation program of the twentieth aspect causes the computer to perform; and a twenty-nine aspect relates to a game program for causing the computer of the twenty-second aspect to perform the steps which the position calculation program of the twenty-second aspect causes the computer to perform. Further, the game programs of the twenty-seventh, twenty-eighth and twenty-ninth aspects respectively cause the computers of the nineteenth, twentieth and twenty-second aspects to each perform a game processing step and a display control step. In each of the twenty-seventh, twenty-eighth and twenty-ninth aspects: the game processing step is a step of performing a predetermined game process for a virtual game world; the display control step is a step of sequentially causing a display device to display at least a portion of the virtual game world; at the positional relationship calculation step, placement directions or placement angles are calculated for a plurality of image pickup devices, respectively; and at the display control step, a display area of the display device is divided into a plurality of display areas, and based on the placement directions or placement angles, the plurality of display areas are allocated to the plurality of image pickup devices, respectively.
A thirtieth aspect is a storage medium storing a game program for causing the computer of the sixteenth aspect to perform: the steps which the position calculation program of the sixteenth aspect causes the computer to perform; a game processing step; a display control step; and a sound control step. The game processing step is a step of performing a predetermined game process for a virtual game world. The display control step is a step of sequentially causing a display device to display at least a portion of a virtual game world. The sound control step is a step of causing a plurality of speakers to output sound in accordance with the predetermined game process performed at the game processing step. At the sound control step, volume of the sound outputted from the speakers is controlled based on the positional relationship.
According to the above first aspect, the positional relationship between the image pickup device and the imaging targets can be precisely calculated by using the sizes of the target images of the imaging targets in the taken image.
According to the above second aspect, even if there are two imaging targets, the positional relationship between the image pickup device and the predetermined point between the first and second imaging targets can be precisely calculated.
According to the above third aspect, even if the image pickup device is diagonally positioned with respect to a direction connecting the first and second imaging targets, the distance between the image pickup device and the middle point between the first and second imaging targets can be precisely calculated.
According to the fourth and fifth aspects, even if there are two imaging targets, a direction in which the image pickup device takes an image of the two imaging targets can be calculated.
According to the above sixth aspect, even if the image pickup device is diagonally positioned with respect to the direction connecting the two imaging targets, the distance between the image pickup device and the middle point between the first and second imaging targets can be precisely calculated by using a cosine theorem.
According to the above seventh aspect, even if the image pickup device is diagonally positioned with respect to the direction connecting the first and second imaging targets, a direction in which the image pickup device takes an image of the first and second imaging targets and the distance between the image pickup device and the middle point between the first and second imaging targets can be precisely calculated.
According to the above eighth aspect, by using the positional relationship between the image pickup device and the imaging targets for the game process, a new game operation input can be performed.
According to the above ninth aspect, by changing a direction in which the image pickup device takes the image of the imaging targets, a player is allowed to perform, e.g., an operation to move a viewpoint of the player in order to view a backside of an object displayed on the display device. Also, by moving the image pickup device back and forth with respect to the imaging targets, the player is allowed to perform, e.g., an operation to move the player's viewpoint close to or away from the displayed object. Thus, a viewing direction or position of the virtual camera is changed in accordance with the position of the image pickup device. This allows the player to have an operation feeling as if the player were moving the virtual camera by moving the controller 7.
According to the above tenth aspect, by changing the direction in which the image pickup device takes the image of the imaging targets, the player is allowed to perform, e.g., an operation to change an angle at which an object in a virtual game world faces another object in the virtual game world. Also, by moving the image pickup device back and forth with respect to the imaging targets, the player is allowed to perform, e.g., an operation to move an object in the virtual game world, which the player is controlling, close to or away from another object in the virtual game world. This allows the player to have an operation feeling as if the player were moving the object in the virtual world by moving the image pickup device.
According to the above eleventh aspect, the vibration generator is caused to generate vibration in accordance with a positional relationship between the image pickup device and a vibration source displayed on the display device, and the vibration is transmitted to the player's hand holding the case in which the vibration generator is provided. This allows the player to feel as if to have approached a real vibration source.
According to the above twelfth to fourteenth aspects, in accordance with the positional relationship between each of the plurality of image pickup devices and the imaging targets, the plurality of divided display areas can be respectively allocated to a plurality of players respectively operating the plurality of image pickup devices. For example, the plurality of divided display areas can be respectively allocated to the plurality of players in accordance with an order in which the players align in a row.
According to the above fifteenth aspect, the volume of the sound reproduced by the speakers can be adjusted in accordance with a viewing direction or viewing distance of a player operating the image pickup device.
The storage medium storing the position calculation program and the storage medium storing the game program according to certain exemplary embodiments produce same effects as those of the above-described position calculation apparatus and game apparatus when a computer executes these programs.
These and other features, aspects and advantages of the certain exemplary embodiments described herein will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.